<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>课程管理</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script src="lib/angular.js"></script>
    <script src="lib/av.js"></script>
    <script src="news.js"></script>
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
</head>
<body ng-app="newsModule">
<nav class="navbar navbar-inverse" role="navigation">
    <div class="navbar-header">
        <a class="navbar-brand" href="#">学通卡后台管理系统</a>
    </div>
    <div>
        <ul class="nav navbar-nav">
           
            <li class="active"><a href="#">课程管理</a></li>
            <li><a href="classSumAudit.html">课程报名情况管理</a></li>
             <li><a href="news.html">资讯管理</a></li>
              <li><a href="login.html">退出登录</a></li>
        </ul>
    </div>
</nav>
<div class="container" ng-controller="ClassCtrl">
    <div>
      
        <table class="table table-bordered">
            <caption><h2>课程列表</h2></caption>
            <thead>
            <tr>
                <th>
                    操作
                </th>
                <th>
                 操作
                </th>
                <!--<th>-->
                    <!--课程名称-->
                <!--</th>-->
                <!--<th>-->
                    <!--课程描述-->
                <!--</th>-->
                <th>
                    老师
                </th>
                <th>
                    课程安排
                </th>
                <th>
                    时间安排
                </th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="subject in subjectArray">
                <td>
                    <button data-toggle="modal" ng-click="editSubject(subject)"
                            data-target="#myModal" class="btn btn-info"> 编辑
                    </button>
                </td>
                <td>
                    <button ng-click="deleteSubject(subject)" class="btn btn-danger">删除</button>
                </td>
                <!--<td>-->
                    <!--<p>{{class.name}}</p>-->
                <!--</td>-->
                <!--<td>-->
                    <!--<p>{{class.description}}</p>-->
                <!--</td>-->
                <td>
                    <p>{{subject.teacher}}</p></td>
                <td>
                    <p>{{subject.course_arrangement}}</p>
                </td>
                <td>
                    <p>{{subject.schooltime}}</p>
                    <p>{{subject.place}}</p>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <hr>

    <hr>
    <div class="table-bordered">
        <h3>新建课程</h3>

        <form ng-submit="addSubject()">
            <div class="form-group">
                <label>请选择课程分类</label>
                <select  ng-model="selected"
                         ng-options="categorySub.name for categorySub in categorySubjectArray" ng-click="test()">
                    <option value="">请选择</option>
                </select>
            </div>
            <p>{{selected.description}}</p>
            <div class="form-group">
                <label>老师名称</label>
                <input type="text" class="form-control"
                       placeholder="请输入老师名称" ng-model="subjectTemp.teacher">
            </div>
            <div class="form-group">
                <label>课程安排</label>
                <input type="text" class="form-control"
                       placeholder="请输入课程安排" ng-model="subjectTemp.course_arrangement">
            </div>
            <div class="form-group">
                <label>时间安排</label>
                <input type="text" class="form-control"
                       placeholder="请输入上课 如每周五19:00-21:00" ng-model="subjectTemp.schooltime">
            </div>
            <div class="form-group">
                <label>上课地点</label>
                <input type="text" class="form-control"
                       placeholder="请输入上课地点 如3-201" ng-model="subjectTemp.place">
            </div>
            <div class="form-group">
                <label>师资介绍</label>
                <input type="text" class="form-control"
                       placeholder="请输入师资介绍" ng-model="subjectTemp.teacher_description">
            </div>
            <button type="submit" class="btn btn-info">提交</button>
            <hr>
        </form>
    </div>
    <!-- 模态框（Modal） -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close"
                            data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        修改课程信息
                    </h4>
                </div>
                <div class="modal-body">
                    <form ng-submit="editSubject()">
                        <div class="form-group">
                            <label for="input_model_title">教师</label>
                            <input type="text" class="form-control" id="input_model_title"
                                   placeholder="请输入教师名字" ng-model="subjectTemp.teacher">
                        </div>
                        <div class="form-group">
                            <label for="input_model_url">教学安排</label>
                            <input type="text" id="input_model_url" ng-model="subjectTemp.course_arrangement"  placeholder="请输入教学安排">

                        </div>
                        <div class="form-group">
                            <label for="input_model_image">上课时间</label>
                            <input type="text" id="input_model_image" ng-model="subjectTemp.schooltime"  placeholder="请输入上课时间 如每周五19:00-21:00">
                        </div>
                        <div class="form-group">
                            <label for="input_model_image">师资介绍</label>
                            <input type="text"  ng-model="subjectTemp.teacher_description"  placeholder="请输入师资介绍">
                        </div>
                        <div class="form-group">
                            <label for="input_model_image">上课地点</label>
                            <input type="text" ng-model="subjectTemp.place"  placeholder="请输入上课地点 如3-201">
                        </div>

                        <div class="modal-footer">
                            <button type="button" class="btn btn-default"
                                    data-dismiss="modal">关闭
                            </button>
                            <button type="submit" class="btn btn-info">提交</button>
                        </div>
                    </form>
                </div>

            </div><!-- /.modal-content -->
        </div><!-- /.modal -->

</div>
</div>
</body>
</html>
